//
//  SwitchSetCell.m
//  IBaby
//
//  Created by ZengYuan on 14/11/27.
//  Copyright (c) 2014年 com.zhongwei. All rights reserved.
//

#import "SwitchSetCell.h"

@implementation SwitchSetCell


-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    self.toggle = [[UISwitch alloc]init];
    [self addSubview:self.toggle];
     return self;
}

// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    [super drawRect:rect];
    self.accessoryType = UITableViewCellAccessoryNone;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
}


-(void)layoutSubviews{
    [super layoutSubviews];
  
    [self.toggle  mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(kScreenWidth-70);
        make.centerY.equalTo(self);
        make.width.equalTo(@50);
        make.height.equalTo(@30);
    }];
//Frame:CGRectMake(kScreenWidth-70, (self.frame.size.height-30)/2, 50, 30);
}

@end
